' This program reads user inputted price data for mutual funds (or stocks)
' and creates a table of such data which can be printed to detect trends
' and performance history. It stores the data in a file named by the
' user -- the default file name is MutualFunds, assumed to be in the
' current directory. Funds, dates, & prices may be added, deleted,
' modified, & resequenced thru mouse-driven menus. The example MutualFunds
' file contains weekly price data for several funds.
' See PrintData: comments to reset printer margins, line width, type style.
'
' By Bill Strack, Strongsville, Ohio, CA-AUG/BBS (tele. 216-341-4452).
'
CLEAR,40000&,9000&
DEFINT i-n
DIM f$(39),d$(100),p(100,39),pb(39),pl(39),ib(39)
PRINT "Read source code header for a description of this program.": PRINT
filename$="MutualFunds"
GetFile:
ON ERROR GOTO trouble
CALL requester ("Input data filename", filename$, "OK", b%)
OPEN "I",#1,filename$: INPUT #1,nfunds,ndates
PRINT "Reading input data from " filename$ " ... ";
FOR i=1 TO nfunds: INPUT #1,f$(i): NEXT
FOR i=1 TO ndates: INPUT #1,d$(i): NEXT
FOR i=1 TO ndates: FOR j=1 TO nfunds
INPUT #1, p(i,j): NEXT j,i: CLOSE #1
PRINT "successfully read.": PRINT
true=1: false=0: incre=false: istart=1
PRINT "Select item from menu using mouse."
MENU 5,0,1," Menu choices:"
MENU 5,1,1," Add fund"
MENU 5,2,1," Delete fund"
MENU 5,3,1," Relocate fund"
MENU 5,4,1," Add date & prices"
MENU 5,5,1," Delete date"
MENU 5,6,1," Change fund name"
MENU 5,7,1," Change date"
MENU 5,8,1," Change price"
MENU 5,9,1," Delete file"
MENU 5,10,1," Display data - incremental"
MENU 5,11,1," Display data"
MENU 5,12,1," Print data - incremental"
MENU 5,13,1," Print data"
MENU 5,14,1," Save data"
MENU 5,15,1," Quit"
ON MENU GOSUB MenuCheck
idle:
MENU ON: GOTO idle
MenuCheck:
MENU 5,item,1: item = MENU(1): MENU 5,item,2
IF item < 9 THEN update=true: BREAK ON: ON BREAK GOSUB Quit
ON item GOSUB AddFund,DeleteFund,RelocateFund,AddPrices,DeleteDate,ChangeFundName,ChangeDate,ChangePrice,DeleteFile,DisplayData.incre,DisplayData,PrintData.incre,PrintData,SaveData,Quit
PRINT "Select another option from the main menu.": PRINT
GOSUB idle
AddFund: f$ = "\12"
CALL requester ("Enter NAME of new fund", f$ ,"Add\Cancel", b%)
IF b% = 1 THEN nfunds = nfunds + 1: f$(nfunds)=f$+SPACE$(12-LEN(f$))